<?php 
/*
 * Session variables:
 * $_SESSION['type'] [string] = user type of the logged in user
 * $_SESSION['authorised'] [boolean] = whether or not the current user is logged in 
 */

session_start();

if(isset($_SESSION['authorised']) && $_SESSION['authorised'] == true)
{
	if(isset($_SESSION['type']))
	{
		if($_SESSION['type'] == 'administrator')
		{
			?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />

<style>
.nav {
	width: 210px;
	height: auto;
	border: thin solid #09C;
	margin-left: 10px;
	text-align: center;
}

.mainline {
	width: 712px;
	height: auto;
	text-align: center;
}
</style>
</head>


<body bgcolor="#FFFFFF">
	<center>
		<div id="wrapper">

			<div id="header">
				<h1></h1>
			</div>


			<div id="header2">
				<h3></h3>
			</div>

			<div id="nav">
				<?php include 'admin_navigation.php';?>
			</div>

			<div id="mainline">
				<h4>Error</h4>
			

			<div id="body">
				<div align="justify">
				<?php 
				if(isset($_SESSION['error'])== true)
				{
					echo $_SESSION['error']; ?></p>
				<?php
				}
				else
				{
					//nothing
				}?>
				<form name=back method=POST>
			<input type=button value=Back onClick=history.go(-1) /></form>
				</div>
</div>


				<p align="justify">
					<br />
				</p>
			</div>

			<br class="clearfloat"> <br />

			<div id="footer">
				<p align="center">
					Tutorial Business Manager: info@tbms.com <br />Credits/Engineers:
					Aquino, Chloebelle; Dela Cruz, Roy Erwin; Maliwanag, Ranyel Bryan;
					Manzano, Audrey Ann; Ng, Sheila Regine<br /> <br />copyright 2011
				</p>
			</div>
		</div>
	</center>
</body>
			<?php
		}
		elseif($_SESSION['type'] == 'student')
		{
			header('Location: student_index.php');
			exit();
		}
		elseif($_SESSION['type'] == 'tutor')
		{
			header('Location: tutor_index.php');
			exit();
		}
		elseif($_SESSION['type'] == 'parent')
		{
			header('Location: parent_index.php');
            exit();
        }
    }
}
else
{
    header('Location: index.php');
}
?>
